<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>-大麦搜索</title>
    <link rel="shortcut icon" href="../static/damai/image/label.ico" th:href="@{/damai/image/label.ico}" type="image/x-icon">
    <link rel="stylesheet" href="../static/damai/css/search.css" th:href="@{/damai/css/search.css}">
    <!--<link rel="stylesheet" href="../static/damai/css/detail_main.css" th:href="@{/damai/css/detail_main.css}">-->

</head>
<body>

<!--页面头部start-->
<div class="my_search_heard">
    <div class="dm-header-wrap">
        <div class="dm-header-box" data-spm="top">
            <a href="javascript:void(0)" th:href="@{/}"><img class="i-logo" src="../static/damai/image/heard/damai_logo.png" th:src="@{/damai/image/heard/damai_logo.png}" alt="大麦"/></a>
            <!--<div class="location-header">-->
            <!--<img class="i-icon-location" src="//img.alicdn.com/tfs/TB1XHDuxNGYBuNjy0FnXXX5lpXa-28-32.png" alt="定位" />-->
            <!--<span class="city-location">全国</span>-->
            <!--<img class="i-arrow-location" src="https://img.alicdn.com/tfs/TB1vnUBxStYBeNjSspaXXaOOFXa-20-12.png" alt="箭头" />-->
            <!--<div class="city-header-wrap">-->
            <!--<div class="city-header" data-spm="city">-->
            <!--<div class="now-city">-->
            <!--<span class="title-city">当前城市:</span>-->
            <!--<span class="name-city select-city">全国</span>-->
            <!--</div>-->
            <!--<div class="hot-city">-->
            <!--<span class="title-city">热门城市:</span>-->
            <!--<div class="list-other"></div>-->
            <!--</div>-->
            <!--<div class="other-city">-->
            <!--<span class="title-city">其他城市:</span>-->
            <!--<div class="list-other"></div>-->
            <!--</div>-->
            <!--</div>-->
            <!--</div>-->
            <!--</div>-->
            <div class="recommend-header">
                <a href="../templates/index.html" th:href="@{/}" class="type-recommend select" data-spm="dhome">首页</a>
                <a href="javascript:void(0)" th:href="@{/search/}" class="type-recommend" data-spm="dcategory">分类</a>
            </div>
            <div class="right-header" data-spm="nick">
                <div class="box-header user-header">
                    <a href="javascript:void(0)" class="J_userinfo_img">
                        <img class="i-box-header i-user" src="../static/damai/image/heard/login_logo.png"
                             th:src="@{/damai/image/heard/login_logo.png}"/>
                    </a>
                    <a th:if="${session.user ne null}" href="javascript:void(0)" th:href="@{/order/orderList}" class="J_userinfo_name">
                        <div class="span-box-header name-user" th:class="${session.user eq null}? 'span-box-header name-user' : 'span-box-header name-user show'"
                             th:text="${session.user.nickName}"></div>
                    </a>
                    <div class="login-user show" th:class="${session.user eq null}? 'login-user show' : 'login-user'">
                        <a href="../templates/login.html" th:href="@{/user/to/login}">
                            <span class="span-box-header span-user">登录</span>
                        </a>
                    </div>
                    <div class="list-wrap">
                        <div class="list-login">
                            <!--<a href="javascript:void(0)" class="li-login select" data-spm="duserinfo">个人信息</a>-->
                            <!--<a href="javascript:void(0)" class="li-login" data-spm="daccountsetting">账号设置</a>-->
                            <a href="/templates/user/order.html" th:href="@{/order/orderList}" class="li-login">订单管理</a>
                            <a th:if="${session.user ne null}" href="javascript:void(0)" th:href="@{/user/logout}"
                               class="li-login out-login" th:class="${session.user ne null}? 'li-login out-login show' : 'li-login out-login'">退出登录</a>
                        </div>
                    </div>
                </div>
                <div class="box-header download-header">
                    <img class="i-box-header i-download" src="../static/damai/image/heard/download_logo.png" th:src="@{/damai/image/heard/download_logo.png}" alt="下载"/>
                    <span class="span-box-header">下载</span>
                    <!--<div class="ewm-download">-->
                    <!--<img class="i-ewm" src="//img.alicdn.com/tfs/TB1r0uFxHSYBuNjSspiXXXNzpXa-280-280.png" />-->
                    <!--</div>-->
                </div>
                <div class="box-header">
                    <a href="javascript:void(0)" data-spm="denglish">
                        <img class="i-box-header" src="../static/damai/image/heard/english_logo.png" th:src="@{/damai/image/heard/english_logo.png}" alt="英文站"/>
                        <span class="span-box-header">English</span>
                    </a>
                </div>
            </div>
            <div class="search-header" data-spm="searchtxt">
                <img class="i-search" src="../static/damai/image/heard/search_logo.png" th:src="@{/damai/image/heard/search_logo.png}" alt="搜索"/>
                <input class="input-search" th:value="${searchName}" placeholder="搜索明星、演出、体育 赛事" type="text"/>
                <div class="btn-search" data-spm="dsearchbtn2">搜索</div>
                <div class="list-search-wrap">
                    <div class="list-search">
                    </div>
                </div>
            </div>

        </div>
    </div>
</div>
<!--页面头部end-->

<!--搜索主体start-->
<div class="search_new clearfix">
    <!--搜索top start-->
    <div class="search_top">
        <p id="navigation_show"></p>
    </div>
    <!--搜索top end-->
    <!--搜索内容start-->
    <div class="search_con clear">
        <!--搜索左边区域start-->
        <div class="search_left">
            <!--条件选择start-->
            <div class="search_city">
                <!-- 加载城市 start  -->
                <!--<a class="search_city_more" href="#" style="display: block;">-->
                    <!--<span class="search_city_up" onclick="javascript:citylinecontrol(0)">更多</span>-->
                    <!--<span class="search_city_off" style="display:none;"-->
                          <!--onclick="javascript:citylinecontrol(1)">收起</span>-->
                <!--</a>-->
                <dl class="search_city_line" id="search_city_line">
                    <dt>城　市：</dt>
                    <dd><a href="javascript:void(0)" value="0" class="dm active">全部</a></dd>
                    <dd class="search_city_num" id="search_city_num_tj">
                        <ul class="search_city_all clear" >
                            <li th:each="area:${areaList}"><a href="javascript:void(0)" onclick="showmsg()"  th:value="${area.getId()}" th:text="${area.getName()}" ></a></li>
                        </ul>
                    </dd>
                </dl>
                <!-- 加载城市 end -->
                <!-- 加载分类 start-->
                <dl id="category_filter_id" class="search_city_line">
                    <dt>分　类：</dt>
                    <dd><a href="javascript:void(0)" value="0" class="dm active">全部</a></dd>
                    <dd class="search_city_num">
                        <ul class="clear" id="event">
                              <li th:each="item:${itemType1}" >
                                  <a href="javascript:void(0)"  th:value="${item.getId()}" th:text="${item.getItemType()}"></a>
                              </li>
                        </ul>
                    </dd>
                </dl>
                <!-- 加载分类 end -->
                <!--加载子类 start block -->
                <dl id="subcategory_filter_id" class="search_city_line" style="display:none">
                    <dt>子&nbsp&nbsp&nbsp&nbsp类：</dt>
                    <dd><a href="javascript:void(0)" value="0" class="on active">全部</a></dd>
                    <dd class="search_city_num">
                        <ul class="clear">
                            <li><a href="javascript:void(0)"></a></li>

                        </ul>
                    </dd>
                </dl>
                <!-- 加载子类 end -->
            </div>
            <!--条件选择end-->
            <!--搜索结果start-->
            <div class="search_main">
                <div class="search_sort">
                    <div class="search_sort_page">
                        <div class="search_sort_com">
                            <a title="列表模式" href="javascript:void(0)" class="search_lis"></a>
                            <a title="大图模式" href="javascript:void(0)" class="search_icon"></a>
                        </div>
                        <div class="search_sort_num">
                            <a href="javascript:void(0)" class="gray search_sort_prev_gray"></a>
                            <p class="search_sort_txt"><span>1</span>/<span>1</span></p>
                            <a class="gray search_sort_next" href="javascript:void(0)" ></a>
                        </div>
                    </div>
                    <ul class="search_sort_way">
                        <!--<li><a id="search_xgj" class="" href="javascript:void(0)">相关度排序</a></li>-->
                        <li><a id="search_rm" href="javascript:void(0)"class="active">推荐排序</a></li>
                        <!--<li><a id="search_ycsj" href="javascript:void(0)">最近开场</a></li>-->
                        <!--<li><a id="search_sjsj" href="javascript:void(0)">最新上架</a></li>-->
                    </ul>
                </div>
                <ul class="search_list_loading">
                    <li style="border: none; margin-left: 30px; height: 40px; margin-top: 25px; display: none;" id="search_loading">
                        <div class="search_loading">努力加载中...</div>
                    </li>
                </ul>
                <!-- 搜索列表 start -->
                <ul class="search_list" id="content_list">

                </ul>

            </div>
            <!--搜索结果end-->
        </div>
        <!--搜索左边区域end-->
        <!--搜索右边区域start-->
        <div class="search_right">
            <div class="search_right_head"></div>
            <!--热门推荐-->
            <div id="guess_you_like">
                <div class="search_box">
                    <div class="search_box_title" data-spm-anchor-id="a2oeg.search_category.0.i1.391d4d15msxAcB">
                        您可能还喜欢
                    </div>
                    <div class="search_box_con">
                        <ul id="search_recom1" class="search_box_hot">
                            <li class="clearfix"><a
                                    href="javascript:void(0)"
                                    target="_blank" class="img"><img title="BIGBANG10 THE EXHIBITION: A TO Z十周年回顾大展北京站"
                                                                     src="../damai/image/search/default_carousel.jpg"
                                                                     width="171" height="214" alt=""></a>
                                <div class="infos">
                                    <div class="title"><a
                                            title="BIGBANG10 THE EXHIBITION: A TO Z十周年回顾大展北京站"
                                            href="javascript:void(0)"
                                            target="_blank">BIGBANG10 THE EXHIBITION: A TO Z十周年回顾大展北京站</a></div>
                                    <p title="798艺术中心">798艺术中心</p>
                                    <p title="2018.12.06-2019.02.24">2018.12.06-2019.02.24</p>
                                    <p class="c-price"><strong>100.0元</strong>起</p></div>
                            </li>
                            <li class="clearfix"><a href="javascript:void(0)"
                                    target="_blank" class="img"><img title="传统京剧《状 元媒》"
                                                                     src="../damai/image/search/default_carousel.jpg"
                                                                     width="171" height="214" alt=""></a>
                                <div class="infos">
                                    <div class="title"><a
                                            ititle="传统京剧《状 元媒》"
                                            href="javascript:void(0)"
                                            target="_blank">传统京剧《状 元媒》</a></div>
                                    <p title="北京市平谷区影剧院">北京市平谷区影剧院</p>
                                    <p title="2019.01.17  14:00">2019.01.17 14:00</p>
                                    <p class="c-price"><strong>10.0元</strong>起</p></div>
                            </li>
                            <li class="clearfix"><a
                                    href="javascript:void(0)"
                                    target="_blank" class="img"><img title="“More Than Love”假如爱有天意 —— 浪漫经典名曲音乐会"
                                                                     src="../damai/image/search/default_carousel.jpg"
                                                                     width="171" height="214" alt=""></a>
                                <div class="infos">
                                    <div class="title"><a
                                            title="“More Than Love”假如爱有天意 —— 浪漫经典名曲音乐会"
                                            href="javascript:void(0)"
                                            target="_blank">“More Than Love”假如爱有天意 —— 浪漫经典名曲音乐会</a></div>
                                    <p title="北京音乐厅">北京音乐厅</p>
                                    <p title="2019.02.14 19:30">2019.02.14 19:30</p>
                                    <p class="c-price"><strong>99.0元</strong>起</p></div>
                            </li>
                        </ul>
                    </div>
                </div>
            </div>
        </div>
        <!--搜索右边区域end-->
    </div>
    <!--搜索内容end-->
</div>
<!--搜索主体end-->

<!--页面底部start-->
<div class="dm-footer">
    <div class="w1200">
        <ul class="footer__links">

            <li class="footer__links__list"><a href="javascript:void(0)" target="_blank" data-spm="flink0">帮助中心</a></li>
            <li class="footer__links__grep">|</li>

            <li class="footer__links__list"><a href="javascript:void(0)"
                                               target="_blank" data-spm="flink1">公司介绍</a></li>
            <li class="footer__links__grep">|</li>

            <li class="footer__links__list"><a href="javascript:void(0)"
                                               target="_blank" data-spm="flink2">品牌识别</a></li>
            <li class="footer__links__grep">|</li>

            <li class="footer__links__list"><a href="javascript:void(0)"
                                               target="_blank" data-spm="flink3">公司大事记</a></li>
            <li class="footer__links__grep">|</li>

            <li class="footer__links__list"><a href="javascript:void(0)"
                                               target="_blank" data-spm="flink4">隐私权专项政策</a></li>
            <li class="footer__links__grep">|</li>

            <li class="footer__links__list"><a
                    href="javascript:void(0)"
                    target="_blank" data-spm="flink5">廉正举报</a></li>
            <li class="footer__links__grep">|</li>

            <li class="footer__links__list"><a href="javascript:void(0)"
                                               target="_blank" data-spm="flink6">联系合作</a></li>
            <li class="footer__links__grep">|</li>

            <li class="footer__links__list"><a
                    href="javascript:void(0)"
                    target="_blank" data-spm="flink7">招聘信息</a></li>
            <li class="footer__links__grep">|</li>

            <li class="footer__links__list"><a
                    href="javascript:void(0)"
                    target="_blank" data-spm="flink8">防骗秘籍</a></li>
        </ul>
        <div class="footer__ft" data-spm-anchor-id="">
            <div class="footer__ft_fl">
                <a href="javascript:void(0)" target="_blank" class="footer__ft__logo">
                    <img src="../static/damai/image/footer/damaibuy_logo.png" th:src="@{/damai/image/footer/damaibuy_logo.png}" alt="">
                </a>
                <div class="footer__ft__code__box">
                    <img class="footer__ft__code" src="../static/damai/image/footer/download_qrcode.png" th:src="@{/damai/image/footer/download_qrcode.png}"
                         alt="">
                    <span>APP下载</span>
                </div>
            </div>
            <div class="footer__ft_fr">
                <div class="footer__fr__contact">

                    <a style="margin-left:0;" href="javascript:void(0)"
                       class="footer__fr__contact__btn alime">在线客服</a>
                </div>
                <ul class="footer__ft__words">
                    <li class="footer__ft__certificate"><a
                            href="javascript:void(0)" target="_blank">京ICP证031057号</a>
                    </li>
                    <li class="footer__ft__grep">|</li>
                    <li class="footer__ft__certificate"><a href="javascript:void(0)" target="_blank">京ICP备11043884号</a>
                    </li>
                    <li class="footer__ft__grep">|</li>
                    <li class="footer__ft__certificate"><a
                            href="javascript:void(0)"
                            target="_blank">京公网安备11010102000430号</a>
                    </li>
                    <li class="footer__ft__grep">|</li>
                    <li class="footer__ft__certificate"><a
                            href="javascript:void(0)" target="_blank">广播电视节目制作经营许可证
                        (京)字第02253号</a></li>
                </ul>
                <ul class="footer__ft__words">
                    <li class="footer__ft__certificate"><a
                            href="javascript:void(0)" target="_blank">网络文化经营许可证
                        京网文[2016]3438-413号</a></li>
                    <li class="footer__ft__grep">|</li>
                    <li class="footer__ft__certificate"><a
                            href="javascript:void(0)" target="_blank">营业性演出许可证
                        京市演587号</a></li>
                </ul>
                <ul class="footer__ft__words">
                    <li class="footer__ft__certificate">北京红马传媒文化发展有限公司 版权所有</li>
                    <li class="footer__ft__certificate"><a
                            href="javascript:void(0)">大麦网</a></li>
                    <li>Copyright 2003-2018 All Rights Reserved</li>
                </ul>
                <div class="footer__ft__img">
                    <span id="siteseal">
                    <script async="" type="text/javascript">
                            function verifySeal() {
                                var bgHeight = "null";
                                var bgWidth = "593";
                                var url = "https:\/\/seal.godaddy.com\/verifySeal?sealID=LU6rXPgk5BZ67ZEYpYS2JcN3AyCJOs6aD3HBo4dwA3iGeqp6csKFmqgB0zLL";
                                window.open(url, 'SealVerfication', 'menubar=no,toolbar=no,personalbar=no,location=yes,status=no,resizable=yes,fullscreen=no,scrollbars=no,width=' + bgWidth + ',height=' + bgHeight);
                            }
                    </script>
                    <img style="cursor:pointer;cursor:hand" class="footer__ft__img1"
                         src="../static/damai/image/footer/TB1gw_ZxNWYBuNjy1zkXXXGGpXa-131-32.gif" th:src="@{/damai/image/footer/TB1gw_ZxNWYBuNjy1zkXXXGGpXa-131-32.gif}" onclick="verifySeal();"
                         alt="SSL site seal - click to verify" data-spm-anchor-id="a2o6e.home.0.i1.5b4d48d3mVzb2Z">
                    </span>
                    <a rel="nofollow" title="电子营业执照" target="_blank"
                       href="javascript:void(0)">
                        <img class="footer__ft__img2" alt=""
                             src="../static/damai/image/footer/TB1ZO80pyOYBuNjSsD4XXbSkFXa-141-41.png" th:src="@{/damai/image/footer/TB1ZO80pyOYBuNjSsD4XXbSkFXa-141-41.png}">
                    </a>

                    <a rel="nofollow" target="_blank" href="javascript:void(0)">
                        <img src="../static/damai/image/footer/TB1Y580pyOYBuNjSsD4XXbSkFXa-83-50.png" th:src="@{/damai/image/footer/TB1Y580pyOYBuNjSsD4XXbSkFXa-83-50.png}" class="footer__ft__img3">
                    </a>
                    <a rel="nofollow" target="_blank"
                       href="javascript:void(0)">
                        <img src="../static/damai/image/footer/TB1pM_ZxNWYBuNjy1zkXXXGGpXa-114-40.png" th:src="@{/damai/image/footer/TB1pM_ZxNWYBuNjy1zkXXXGGpXa-114-40.png}"
                             class="footer__ft__img4w">
                    </a>
                    <a target="_blank" href="javascript:void(0)"
                       id="___szfw_logo___">
                        <img class="footer__ft__img4" src="../static/damai/image/footer/TB1C4nNxTlYBeNjSszcXXbwhFXa-114-42.png" th:src="@{/damai/image/footer/TB1C4nNxTlYBeNjSszcXXbwhFXa-114-42.png}">
                    </a>
                    <script type="text/javascript">(function () {
                        document.getElementById('___szfw_logo___').oncontextmenu = function () {
                            return false;
                        }
                    })();</script>
                </div>
            </div>
        </div>
    </div>
</div>
<!--页面底部end-->

<!--侧边工具start-->
<div class="sidebar" data-spm="slidelayer" data-spm-max-idx="2">
    <div class="item">
        <a class="alime"
           href="javascript:void(0)"
           target="_blank" data-spm="dcustomerservice" data-spm-anchor-id="a2oeg.home.slidelayer.dcustomerservice">
            <div class="icon service" data-spm-anchor-id="a2oeg.home.dcustomerservice.i0.e5a523e1o7vKEG"></div>
            <p>在线客服</p>
        </a>
    </div>
    <div class="item" style="border-bottom-width: 0px;">
        <a href="javascript:void(0)" target="_blank" data-spm-anchor-id="a2oeg.home.slidelayer.2">
            <div class="icon damai"></div>
            <p>APP下载</p>
        </a>
    </div>
    <div class="item J_GoTop" style="display: none;">
        <div class="icon gotop"></div>
        <p>回到顶部</p>
    </div>
</div>
<!--侧边工具end-->
<input type="hidden" th:value="${searchType}" name="searchType">
<script src="../static/js/jquery-3.3.1.min.js" th:src="@{/js/jquery-3.3.1.min.js}"></script>
<!--<script th:inline="javascript">-->
<script>
    var area=""
    var itemType1=""
    var itemType2 =""
    var curPage=""
    var sort=""
    var text=""
    //首次-初始化数据
    $(function () {
        //    登录栏下拉框start=======================
        $('.right-header .user-header').mouseover(function () {
            $(this).addClass('on');
        });
        $('.right-header .user-header').mouseout(function () {
            $(this).removeClass('on');
        });
        //    登录栏下拉框end=======================
        first();
        // var searchName = $(".input-search").val();
        // if(searchName != null && searchName != ''){
           // post();
        // }

        var searchTypeValue = $('input[name=searchType]').val();
        // if(searchTypeValue != null){
        //     $("#category_filter_id a").each(function () {
        //         if($(this).attr('value') == searchTypeValue){
        //             searchType($(this),searchTypeValue);
        //         }
        //     })
        //
        // }
    })
    //模糊搜索
    $(".btn-search").click(function () {
        $('#category_filter_id a.dm').removeClass('active');
        $('#search_city_line a.dm').removeClass('active');
        //初始化子类值
        $('#subcategory_filter_id a.active').attr("value","0")
        showItemType2("")
        //初始化分类值
        $('#category_filter_id a.dm').eq(0).addClass("active")
        //初始化城市值
        $("#search_city_line a.dm").eq(0).addClass("active")
        //初始化其余值
        $(".search_sort_num p > span ").eq(0).text(1)

        first()
    })

    // 参数-分类-事件
    $("#category_filter_id").on("click","a.dm",function(){
        searchType($(this));
    })
    // 参数-城市-事件
    $("#search_city_line").on("click","a.dm",function(){
        text=$(".input-search").val();
        $(".search_sort_num p > span ").eq(0).text(1)
        $('#search_city_line a.active').removeClass("active")
        if(text != ""){
            $(this).addClass("active")
            var aear1 = $(this).attr("value")
            if(aear1 != 0){
                cpost()
            }else{
                showItemType2("")
                $('#category_filter_id a.active').removeClass("active")
                $("#category_filter_id a.dm").eq(0).addClass("active")
                cpost()
            }
        }else{
            $(this).addClass("active")
        }
        post()
    })
    // 参数-子类-事件
    $("#subcategory_filter_id").on("click","a.on",function(){
        $(".search_sort_num p > span ").eq(0).text(1)
        $('#subcategory_filter_id a.active').removeClass("active")
        $(this).addClass("active")
        post()
    })
    // 排序-时间-事件
    $("#search_time a").click(function () {
        $('#subcategory_filter_id a.active').attr("value","0")
        $(".search_sort_num p > span ").eq(0).text(1)
        var a = $(this).text()
        $('#search_time a').removeClass("active")
        if(a == "全部"){
            $(this).addClass("active")
        }else if(a == "今天"){
            $(this).addClass("active")
        }else if(a == "明天"){
            $(this).addClass("active")
        }else if(a == "本周末"){
            $(this).addClass("active")
        }else if(a == "一个月内"){
            $(this).addClass("active")
        }else if(a =="按日历"){
        }
    })
    // 排序-功能-事件
    $('.search_sort_way a').click(function () {
        var a = $(this).text()
        $('.search_sort_way a').removeClass("active")
        if(a == "相关度排序"){
            $(this).addClass("active")
        }else if(a == "推荐排序"){
            $(this).addClass("active")
        }else if(a == "最近开场"){
            $(this).addClass("active")
        }else if(a == "最新上架"){
            $(this).addClass("active")
        }
    })
    // 数据样式1列表 2大图
    $('.search_sort_com a').click(function () {
        var title = $(this).attr("title")
        $("#content_list").removeClass("search_pic_list")
        if(title == "列表模式"){
            $('.search_sort_com a').removeClass("search_icon_on")
            $(this).addClass("search_lis_on")
        }else if(title == "大图模式"){
            $('.search_sort_com a').removeClass("search_lis_on")
            $(this).addClass("search_icon_on")
            $("#content_list").addClass("search_pic_list")
        }
        post()
    })
    // 分页-上部分-事件
    $('.search_sort_num').on("click","a.gray",function () {
        var a=$(this).index()
        var b=$(".search_sort_num p > span ").eq(0).text()
        var c=$(".search_sort_num p > span ").eq(1).text()
        if(a == 0){
            if(parseInt(b) > 1){--b}
        }else{
            if(parseInt(b) < parseInt(c)){++b}
        }
        $(".search_sort_num p > span ").eq(0).text(b)
        post()
    })
    // 分页-下部分-事件
    $('.search_main').on("click","li.page",function () {
        var a=""
        var d=""
        var b=""
        var c=""
        c = $(".search_sort_num p > span ").eq(1).text()
        d = $(".search_sort_num p > span ").eq(0).text()
        a = $(this).text()
        if(a == "上一页"){
            if(parseInt(d) > 1){
                --d
                $(".search_sort_num p > span ").eq(0).text(d)
            }
        }else if(a == "下一页"){
            if(parseInt(d) < parseInt(c)){
                ++d
                $(".search_sort_num p > span ").eq(0).text(d)
            }
        }else if(parseInt(a) >0){
            $('.search_main li.page').removeClass("search-page-act")
            $(this).addClass("search-page-act")
            b=$('.search_main li.search-page-act').text();
            $(".search_sort_num p > span ").eq(0).text(b)
        }
        post()


    })
    //首次请求
    function first() {
        if(  $('.search_sort_com a').eq(1).attr("class") != "search_icon search_icon_on"
            &&  $('.search_sort_com a').eq(0).attr("class") != "search_lis search_lis_on"){
            $('.search_sort_com a').eq(0).addClass("search_lis_on")
        }

        text=$(".input-search").val();
        if(text != null && text != ""){
            $.ajax({
                url: '/search/queryItemType2',
                type: 'post',
                data: {text: text},
                dataType: "json",
                success: function (data) {
                    mshow1(data)
                }
            })

        }else {
            $.ajax({
                url: '/search/test2',
                type: 'post',
                dataType: "json",
                success: function (data) {
                    pshow(data)
                }
            })
        }
        post()
    }
    //分类事件
    function searchType(pageType,searchTypeValue) {
        text=$(".input-search").val();
        $('#subcategory_filter_id a.active').attr("value","0")
        $(".search_sort_num p > span ").eq(0).text(1)
        $('#category_filter_id a.active').removeClass("active")
        $(pageType).addClass("active")
        if(text != ""){
            $(pageType).addClass("active")
            // var itemType1 = $(pageTpye).attr("value")
            var itemType1 = '';
            if(searchTypeValue != null){
                itemType1 = searchTypeValue;
            }else {
                itemType1 = $(pageType).attr("value")
            }
            //alert(itemType1)
            if(itemType1 != 0){
                cpost()
                zpost()
            }else{
                showItemType2("")
                cpost()
            }

        }else{
            $(this).addClass("active")
            // var itemType1 = $(pageType).attr("value")
            var itemType1 = '';
            if(searchTypeValue != null){
                itemType1 = searchTypeValue;
            }else {
                itemType1 = $(pageType).attr("value")
            }
            $.ajax({
                type: 'POST',
                data:{itemType1:itemType1},
                url: '/search/queryItemType',
                cache: false,
                success: function (data) {
                    showItemType2(data)
                }
            })
        }
        post()
    }

    //请求 动态 子类
    function zpost(){
        area = $("#search_city_line a.active").attr("value")
        itemType1 = $('#category_filter_id a.active').attr("value")
        itemType2 = $('#subcategory_filter_id a.active').attr("value")
        text=$(".input-search").val();
        //alert(area +" "+ itemType1 +" "+itemType2)
        $.ajax({
            url: '/search/queryItemType1',
            type: 'post',
            data: {area:area,itemType1:itemType1,itemType2:itemType2,text: text},
            dataType: "json",
            success: function (data) {
                showItemType2(data)
            }
        })
    }
    //请求 动态 城市 分类
    function cpost(){
        area = $("#search_city_line a.active").attr("value")
        itemType1 = $('#category_filter_id a.active').attr("value")
        itemType2 = $('#subcategory_filter_id a.active').attr("value")
        text=$(".input-search").val();
        // alert(area +" "+ itemType1 +" "+itemType2)
            $.ajax({
                url: '/search/queryItemType2',
                type: 'post',
                data: {area:area,itemType1:itemType1,itemType2:itemType2,text: text},
                dataType: "json",
                success: function (data) {
                    mshow1(data)
                }
            })
        }
    //发送请求
    function post() {
        area="0"
        itemType1="0"
        itemType2="0"
        curPage="0"
        area = $("#search_city_line a.active").attr("value")
       // area = $()
        itemType1 = $('#category_filter_id a.active').attr("value")
        itemType2 = $('#subcategory_filter_id a.active').attr("value")
        curPage = $(".search_sort_num p > span ").eq(0).text()
        text=$(".input-search").val();
        // alert(area +" "+ itemType1 +" "+itemType2+" "+curPage)
        if(area == undefined){area = "0"}
        if(itemType1 == undefined){itemType1 = "0"}
        if(itemType2 == undefined){itemType2 = "0"}
        $.ajax({
            type: 'POST',
            url: '/search/test',
            data:{area:area,itemType1:itemType1,itemType2:itemType2,curPage:curPage,text:text},
            cache: false,
            success: function (data) {
                if(data.rows.length == 0){
                    fshow()
                }else {
                    show(data);
                }
            }
        })
    }

    //渲染子类
    function showItemType2(data) {
        var html = ''
        if(data == ""){
            html = ''
            html +='<dt>子&nbsp&nbsp&nbsp&nbsp类：</dt>'
            html +='<dd><a href="javascript:void(0)" value="0" class="on active">全部</a></dd>'
            html +='<dd class="search_city_num">'
            html +='<ul class="clear">'
            $('#subcategory_filter_id').html(html)
            $('#subcategory_filter_id').attr("style","display:none")
        }else {
            html = ''
            html +='<dt>子&nbsp&nbsp&nbsp&nbsp类：</dt>'
            html +='<dd><a href="javascript:void(0)" value="0" class="on active">全部</a></dd>'
            html +='<dd class="search_city_num">'
            html +='<ul class="clear">'
            for (var i = 0; i < data.length; i++) {
                html += '<li>'
                html += ' <a href="javascript:void(0)" class="on" value=' + data[i].id + '>' + data[i].itemType + '</a>'
                html += '</li>'
            }
            $('#subcategory_filter_id').html(html);
            $('#subcategory_filter_id').attr("style","display:block")
        }
    }
    //普通-渲染-参数栏
    function pshow(data) {
        $('#category_filter_id a.active').removeClass("active")
        var aa =$('input[name=searchType]').val();
            var html = ''

                for (var i = 0; i < data.areaVos.length; i++) {
                    html += '<li><a href="javascript:void(0)" class="dm" value="' + data.areaVos[i].id + '">' + data.areaVos[i].name + '</a></li>'
                }
                $("#search_city_num_tj ul").html(html)


                html =""
        if(data != "") {
            for (var a=0;a<data.itemType1Vos.length;a++){
                if(aa == data.itemType1Vos[a].id){
                    html +='<li><a href="javascript:void(0)" class="dm active"  value="'+data.itemType1Vos[a].id+'">'+data.itemType1Vos[a].itemType+'</a></li>'
                }else{
                    html +='<li><a href="javascript:void(0)" class="dm"  value="'+data.itemType1Vos[a].id+'">'+data.itemType1Vos[a].itemType+'</a></li>'
                }

            }
            $("#event").html(html)
        }else{
            for (var a=0;a<data.itemType1Vos.length;a++){
                html +='<li><a href="javascript:void(0)" class="dm"  value="'+data.itemType1Vos[a].id+'">'+data.itemType1Vos[a].itemType+'</a></li>'
            }
            $("#event").html(html)
        }


        }

    // 模糊-渲染-参数栏
   function mshow1(data) {
       area = $("#search_city_line a.active").attr("value")
       itemType1 = $('#category_filter_id a.active').attr("value")
       itemType2 = $('#subcategory_filter_id a.active').attr("value")

       //alert(area +" "+ itemType1 +" "+itemType2)
       var html = ''
        if(data != "") {
             html = ''
            for (var i = 0; i < data.areaVos.length; i++) {
                if(area == data.areaVos[i].id){
                    html += '<li><a href="javascript:void(0)" class="dm active" value="' + data.areaVos[i].id + '">' + data.areaVos[i].name + '</a></li>'
                }else{
                    html += '<li><a href="javascript:void(0)" class="dm" value="' + data.areaVos[i].id + '">' + data.areaVos[i].name + '</a></li>'
                }
            }
            $("#search_city_num_tj ul").html(html)


            html = ''
            for (var a = 0; a < data.itemType1Vos.length; a++) {

                     if(itemType1 == data.itemType1Vos[a].id){
                         html += '<li><a href="javascript:void(0)" class="dm active"  value="' + data.itemType1Vos[a].id + '">' + data.itemType1Vos[a].itemType + '</a></li>'
                     }else{
                         html += '<li><a href="javascript:void(0)" class="dm"  value="' + data.itemType1Vos[a].id + '">' + data.itemType1Vos[a].itemType + '</a></li>'
                     }
                 }



            $("#event").html(html)
        }else{
             html = ""
            $("#search_city_num_tj ul").html(html)
            $("#event").html(html)

        }

   }

    //渲染数据
    function show(data){

        $('#search_loading').attr("style","border: none; margin-left: 30px; height: 40px; margin-top: 25px; display: block;")
        //alert("看下效果")
        var html = ''
        html += '<a href="javascript:void(0)" class="gray search_sort_prev"></a>'
        html += '<p class="search_sort_txt"><span>'+data.curPage+'</span>/<span>'+data.pageCount+'</span></p>'
        html += '<a class="gray search_sort_next" href="javascript:void(0)" ></a>'
        $(".search_sort_num").html(html)
        //商品总数
        html = ''
        html += '共<span class="cf">' + data.total + '</span>个商品'
        $('#navigation_show').html(html)
        //数据渲染
        html = ''
        //真 选中列表  假 选中大图
        sort = $(".search_sort_com a").hasClass("search_lis_on")
        if(sort == true) {
            for (var i = 0; i < data.rows.length; i++) {
                var  t=data.rows[i].startTime
                var  t2=data.rows[i].endTime
                //alert(data.rows[i].id)
                html += '<li>'
                html += '<div class="search_img">'
                html += ' <a href="/detail/content?itemId=' + data.rows[i].id + '" target="_blank" title="标题">'
                html += '<img src="/damai/image/search/' + data.rows[i].imgUrl + '" width="115" height="155">'
                html += '</a></div>'
                html += '<div class="search_txt">'
                html += '<h3>【' + data.rows[i].areaName + '】 <a id="search_log_172100"href="/detail/content?itemId=' + data.rows[i].id + '"target="_blank">' + data.rows[i].itemName + '</a></h3>'
                html += '<p class="search_txt_cut c3">' + data.rows[i].abstractMessage + '</p>'
                html += '<p class="search_txt_time c3"><a href="' + data.rows[i].id + '" class="search_txt_time_icon"></a>' + timestampToTime2(t2)+" - "+ timestampToTime2(t) + '</p>'
                html += '<p class="c1"><span class="c3 search_txt_site_icon">' + data.rows[i].address + ' - ' + data.rows[i].areaName + '</span></p>'
                html += '<p class="search_txt_piao"><em>' + data.rows[i].minPrice + ' - ' + data.rows[i].maxPrice + '</em>售票中</p></div>'
                html += '</li>'
            }
        }else {
            var k=0
            var  t=0
            var  t2=0
            var m = Math.ceil(data.rows.length / 4)
            for (var j = 0; j < m; j++){
                html += '<li>'
                    for (var l = 0; l < 4; l++) {
                        if (k < data.rows.length) {
                              t=data.rows[k].startTime
                              t2=data.rows[k].endTime
                            //图片
                            html += '<div class="search_pic_item">'
                            html += '<div class="search_pic_item_ct" style="display: block;">'
                            html += '<div class="search_pic_img">'
                            html += '<a id="search_log_pic_172561" href="/detail/content?itemId=' + data.rows[k].id + '" target="_blank"><img src="/damai/image/search/' + data.rows[k].imgUrl + '" alt=""></a>'
                            html += '</div>'
                            //文字
                            html += '<div class="search_pic_txt"> '
                            html += '<h3><a id="search_log_172561" href="/detail/content?itemId=' + data.rows[k].id + '" data-spm="ditem_3" target="_blank">【' + data.rows[k].areaName + '】 ' + data.rows[k].itemName + '</a></h3>'
                            html += '<p class="search_txt_time c3"><a href="javascritp:void(0)" class="search_txt_time_icon"></a>'+ timestampToTime2(t2)+" - "+ timestampToTime2(t) +  '</p>   '
                            html += '<p class="search_txt_piao"><em><em>' + data.rows[k].minPrice + ' - ' + data.rows[k].maxPrice + '</em></em>售票中</p>'
                            html += '<p class="search_pic_icon"></p>  '
                            html += '</div></div></div>'
                        }
                        ++k
                    }
                html += '</li>'
            }
        }
        //alert(html)
        //分页导航
        html += '<li id="search_list_page_tj" class="search_list_page">'
        html += '<div class="">'
        html += '<ul class="search-page-list">'
        html += '<ul class="search-page-num">'
        if(data.pageCount > 1 && data.pageCount < 7  ){
            html += '<li class="page search-pagePrev">上一页</li>'
            for (var j = 1; j < data.pageCount+1; j++){
                if(j==data.curPage){
                    // search-page-act
                    html += '<li class="page  search-page-act" >'+ j +'</li>'
                }else {
                    html += '<li class="page" >'+ j +'</li>'
                }
            }
            html += '<li class="page search-pageNext">下一页</li>'
        } else if(data.pageCount >= 8 && data.curPage <6){
            html += '<li class="page search-pagePrev">上一页</li>'
            for (var j = 1; j <7; j++){
                    if(j==data.curPage){
                       // search-page-act
                        html += '<li class="page  search-page-act" >'+ j +'</li>'
                    }else {
                        html += '<li class="page" >'+ j +'</li>'
                    }
            }
            html +='<li class="search-page-more">...</li>'
            html += '<li class="page" >'+ data.pageCount +'</li>'
            html += '<li class="page search-pageNext">下一页</li>'
        } else if(data.pageCount >= 8 && data.curPage >=6 && (data.pageCount-data.curPage) >= 5){
            html += '<li class="page search-pagePrev">上一页</li>'
            html += '<li class="page " >1</li>'
            html +='<li class="search-page-more">...</li>'
            html +='<li class="page" >'+ (data.curPage - 2) +'</li>'
            html +='<li class="page" >'+ (data.curPage - 1) +'</li>'
            html +='<li class="page search-page-act" >'+ data.curPage +'</li>'
            html +='<li class="page" >'+ (data.curPage + 1) +'</li>'
            html +='<li class="page" >'+ (data.curPage + 2) +'</li>'
            html +='<li class="search-page-more">...</li>'
            html +='<li class="page">'+ data.pageCount +'</li>'
            html += '<li class="page search-pageNext">下一页</li>'
        }else if(data.pageCount >= 8 && data.curPage >=6 && (data.pageCount-data.curPage) < 5){
            html += '<li class="page search-pagePrev">上一页</li>'
            html += '<li class="page " >1</li>'
            html +='<li class="search-page-more">...</li>'
            for (var n=5;n>-1;n--){
                if((data.pageCount-n) ==data.curPage){
                    html +='<li class="page search-page-act" >'+ (data.pageCount-n) +'</li>'
                }else {
                    html +='<li class="page" >'+ (data.pageCount-n) +'</li>'
                }
            }
            html += '<li class="page search-pageNext">下一页</li>'
        }
        html += ' </ul> </ul> </div> </li>'
        $('#content_list').html(html);
        $('#search_loading').attr("style","border: none; margin-left: 30px; height: 40px; margin-top: 25px; display: none;")
    }
    //空数据渲染
    function fshow() {
        var html = ''
        $('#search_loading').attr("style","border: none; margin-left: 30px; height: 40px; margin-top: 25px; display: block;")
        //页数
        html += '<a href="javascript:void(0)" class="search_sort_prev_gray"></a>'
        html += '<p class="search_sort_txt"><span>1</span>/<span>1</span></p>'
        html += '<a class="search_sort_next_gray" href="javascript:void(0)" ></a>'
        $(".search_sort_num").html(html)
        //商品总数
        html = ''
        html += '共<span class="cf">0</span>个商品'
        $('#navigation_show').html(html)
        html = ''
        html +='<li class="now">没有找到符合条件的商品。您可以减少筛选条件重新搜索。</li>'
        $('#content_list').html(html);
        $('#search_loading').attr("style","border: none; margin-left: 30px; height: 40px; margin-top: 25px; display: none;")
    }
    //时间戳转换日期格式 (yyyy.MM.DD HH:mm )
    function timestampToTime(tiem) {
        var date = new Date(parseInt(tiem));
        var year = date.getFullYear();
        var month = date.getMonth();
        var day = date.getDate();
        var h = date.getHours();
        var m = date.getMinutes();
        return year+"."+(month+1)+"."+day+" "+ h+":"+m;
    }
    //时间戳转换日期格式2(HH:mm)
    function timestampToTime2(tiem) {
        var date = new Date(parseInt(tiem));
        var year = date.getFullYear();
        var month = date.getMonth();
        var day = date.getDate();
        return year +"."+ month+"." + day;
    }


</script>
</body>
</html>